<?php
class sms_message_model extends  cms_model{
	
	public function __construct(){
		parent::__construct();
		$this->table = 'sms_message';
	}
	public function filter($limit = FALSE, $order = FALSE) {
		$where =  array ($this->table.'.user_id' => $this->user_id);
		$this->order='id DESC';
		$config ['total_rows'] = $this->get($where, TRUE );
		if ($limit)
			$config ['per_page'] = $limit;
		else
			$config ['per_page'] = 30;

		
	
	
		$data = $this->get ($where, FALSE, 'result', $config ['per_page'],false,false);
		// $data['pagination'] = $this->cms_pagination($url = 'index', $config['total_rows'], $config['per_page']);
		return $data;
	}
	
	
	
}

?>